<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="axios.min.js"></script>
</head>

<body>
    <div id="app">
        <table border="1px">
            <tr v-for="(teacher,index) in listTeacher">
                <td>{{teacher.name}}</td>
                <td>{{teacher.age}}</td>
            </tr>
        </table>
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                listTeacher: [],
            },
            methods: {
                getTeacher() {
                    axios.get("http://localhost:8081/admin/edu/teacher/findAll").then((result) => {
                        console.log(result.data);
                        this.listTeacher = result.data.data.items;
                    }).catch((err) => {

                    });
                },
                getJson() {
                    axios.get("./data.json").then((result) => {
                        this.listTeacher = result.data.data.items;
                        console.log(this.listTeacher);
                    }).catch((err) => {
                        console.log(err.data);
                    });
                }
            },
            created() {
                // this.getTeacher();
                this.getJson();
            }
        });
    </script>
</body>

</html>